<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>商标超市</title>

    <!-- Bootstrap -->
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

    <!--自建css文件-->
    <link rel="stylesheet" href="__STATIC__/index/css/cmgd.css">
    <link rel="stylesheet" href="__STATIC__/admin/js/laypage/skin/laypage.css">
    <script src="__STATIC__/admin/js/laypage/laypage.js"></script>
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/jquery.form.js"></script>
    <script src="/static/admin/js/layer/layer.js"></script>
    <script src="/static/admin/js/laypage/laypage.js"></script>
    <script src="/static/admin/js/laytpl/laytpl.js"></script>
    <script src="/static/admin/js/lunhui.js"></script>
</head>
<div>
    {include file="index/header" /}
</div>
<div class="container">
    <div  class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title"><i class="glyphicon glyphicon-folder-open"></i> 商标分类</h3>
        </div>
        <div class="panel-body">
            <div>
                {volist name ='type' id = 'type' }
                <a href="{:url('Index/search_trademark',array('id'=>$type.id))}">
                    <!--search_trademark.html?id={$type.id}-->
                    <div style="width:122px;float: left;">{if condition = "$type.id  lt 10"} 0{$type.id}&nbsp;
                        {$type.type}&nbsp;&nbsp; {else}{$type.id}&nbsp;&nbsp;{$type.type}&nbsp;&nbsp;{/if}</div>
                </a>
                {/volist}
            </div>
        </div>
    </div>
</div>
<!--中间三列的排版面，row-->
<div class="container" >
    <div class="row">
        <div class="col-xs-4">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="glyphicon glyphicon-search"></i> 商标搜索</h3>
                </div>
                <div class="panel-body">
                    <form class="form-horizontal m-t" name="add" id="add" method="post" action="{:url('search')}">
                        <div class="input-group">
                            <span class="input-group-addon" >商标类型：</span>
                            <select class="form-control m-b chosen-select" name="type" id="type">
                                <option value="">请选择</option>
                                {if !empty($cate)}
                                {foreach name="cate" item="cate"}
                                <option value="{$cate.id}">{$cate.id} {$cate.type}</option>
                                {/foreach}
                                {/if}
                            </select>
                        </div>
                        <div class="input-group input-group-sm">
                            <span class="input-group-addon " id="basic-addon1">注册号：</span>
                            <input type="text" class="form-control" placeholder="商标注册号" aria-describedby="basic-addon1"
                                   name="registration" id="registration">
                        </div>

                        <div class="input-group input-group-sm">
                            <span class="input-group-addon " id="basic-addon2">商标名称：</span>
                            <input type="text" class="form-control" placeholder="商标名称" aria-describedby="basic-addon2"
                                   name="name" id="name">
                        </div>
                        <div class="input-group input-group-sm">
                            <span class="input-group-addon " id="basic-addon3">群组：</span>
                            <input type="text" class="form-control" placeholder="请输入商品如'服装'或小分类'2501'" aria-describedby="basic-addon3" name="cluster" id="cluster">
                        </div>
                        <div class="col-sm-4 col-sm-offset-3">
                            <button class="btn btn-primary" type="submit">搜索</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>



        <div class="col-xs-4" style="width:66%;">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="glyphicon glyphicon-book"></i>商标超市</h3>
                </div>
                <div class="panel-body">
                    <div class="row">
                        <!--开始商标循环，循环8个-->
                        <div id="arlist">
                        </div>
                        <div id="AjaxPage" style="text-align:center;"></div>
                        <div style="text-align: center;">
                            <span id="allpage"></span>
                        </div>
                        <script type="text/javascript">
                            function Ajaxpage(page){
                                $.post('{:url("trademarks")}',
                                        {page:page},
                                        function(data){
                                            if(data.code==1){
                                                var res = data.data;
                                                var result ='';
                                                res.forEach(function(v){
                                                    result = result +  "<div class='col-xs-3'><div class='thumbnail' style='width:155px;height:128px;'><a href='show_trademark.html?id="+v.id+"'><img src='/uploads/images/"+v.pic+"' alt='商标名称' style='height:83px;'></a><div class='caption'><a href='show_trademark.html?id="+v.id+"'><p style='text-align:center'>"+v.name+"</p></a></div></div></div>";
                                                })
                                                $('#arlist').html(result);
                                                laypage({
                                                    cont: $('#AjaxPage'),//容器。值支持id名、原生dom对象，jquery对象,
                                                    pages: data.count,//总页数
                                                    skip: true,//是否开启跳页
                                                    skin: '#1AB5B7',//分页组件颜色
                                                    curr: page,
                                                    groups: 3,//连续显示分页数
                                                    jump: function(obj, first){
                                                        if(!first){
                                                            Ajaxpage(obj.curr)
                                                        }
                                                        $('#allpage').html('第'+ obj.curr +'页，共'+ obj.pages +'页');
                                                    }
                                                });
                                            }
                                        });
                                return false;
                            }
                            Ajaxpage();
                        </script>
                    </div>
                </div>

                <!--</div>-->
                <!--</div>-->
            </div>
        </div>
    </div>
</div>

<!--主体结束-->
<div class="clear" style=" clear:both;"> </div>
{include file="index/footer" /}
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

</body>
</html>

